package com.spzx.product.service.impl;

import com.spzx.product.api.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author GQS @Date 2024/9/20/9:30 @Description
 */
/**
 * 品牌Service业务层处理
 */
@Service
public class BrandServiceImpl implements BrandService {

    @Autowired
    private BrandMapper brandMapper;
    // @Autowired
    // public BrandServiceImpl(BrandMapper brandMapper) {
    //     this.brandMapper = brandMapper;
    // }

    // @Autowired
    // public void setBrandMapper(BrandMapper brandMapper) {
    //     this.brandMapper = brandMapper;
    // }

    /**
     * 查询分类品牌列表
     *
     * @param brand 分类品牌
     * @return 分类品牌
     */
    @Override
    public List<Brand> selectBrandList(Brand brand) {
        return brandMapper.selectBrandList(brand);
    }

    @Override
    public Brand selectBrandById(Long id) {
        return brandMapper.selectBrandById(id);
    }

    @Override
    public int insertBrand(Brand brand) {
        return brandMapper.insertBrand(brand);
    }

    @Override
    public int updateBrand(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    @Override
    public int deleteBrandByIds(Long[] ids) {
        return brandMapper.deleteBrandByIds(ids);
    }

    @Override
    public List<Brand> selectBrandAll() {
        return brandMapper.selectBrandList(null);
    }

}
